CREATE TABLE [dbo].[TMPLAN_AUDI]
(
[CO_EMPR_ORIG] [dbo].[TD_VC_002] NOT NULL,
[CO_CNTA_ORIG] [dbo].[TD_VC_020_CNTA] NOT NULL,
[NU_ANNO_ORIG] [dbo].[TD_IN_004_ANNO] NULL CONSTRAINT [DF__TMPLAN_AU__NU_AN__10216507] DEFAULT (datepart(year,getdate())),
[CO_MONE_ORIG] [dbo].[TD_VC_003] NOT NULL,
[ST_MONE_ORIG] [dbo].[TD_VC_001_SINO] NOT NULL CONSTRAINT [DF__TMPLAN_AU__ST_MO__1209AD79] DEFAULT ('N'),
[ST_AUXI_ORIG] [dbo].[TD_VC_001_SINO] NOT NULL CONSTRAINT [DF__TMPLAN_AU__ST_AU__13F1F5EB] DEFAULT ('N'),
[TI_AUXI_ORIG] [dbo].[TD_VC_001] NULL,
[ST_DOCU_ORIG] [dbo].[TD_VC_001_SINO] NOT NULL CONSTRAINT [DF__TMPLAN_AU__ST_DO__15DA3E5D] DEFAULT ('N'),
[TI_DOCU_ORIG] [dbo].[TD_VC_003] NULL,
[CO_CNCP_ORIG] [dbo].[TD_VC_020_CNTA] NULL,
[ST_GEST_ORIG] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TMPLAN_AU__ST_GE__18B6AB08] DEFAULT ('N'),
[CO_CNDE_ORIG] [dbo].[TD_VC_020_CNTA] NULL,
[CO_CNCO_ORIG] [dbo].[TD_VC_020_CNTA] NULL,
[CO_CNCI_ORIG] [dbo].[TD_VC_020_CNTA] NULL,
[CO_GADI_ORIG] [dbo].[TD_VC_020_CNTA] NULL,
[CO_PEDI_ORIG] [dbo].[TD_VC_020_CNTA] NULL,
[CO_CNRE_ORIG] [dbo].[TD_VC_020_CNTA] NULL,
[CO_FLCA_ORIG] [dbo].[TD_VC_010] NULL,
[CO_FLAB_ORIG] [dbo].[TD_VC_010] NULL,
[ST_CNCA_ORIG] [dbo].[TD_VC_003] NOT NULL,
[ST_CNMO_ORIG] [dbo].[TD_VC_001_SINO] NOT NULL CONSTRAINT [DF__TMPLAN_AU__ST_CN__2057CCD0] DEFAULT ('N'),
[ST_CNCT_ORIG] [dbo].[TD_VC_003] NOT NULL,
[ST_CNNA_ORIG] [dbo].[TD_VC_003] NOT NULL,
[ST_ORDE_ORIG] [dbo].[TD_VC_001_SINO] NOT NULL CONSTRAINT [DF__TMPLAN_AU__ST_OR__22401542] DEFAULT ('N'),
[TI_SITU_ORIG] [dbo].[TD_VC_003] NOT NULL CONSTRAINT [DF__TMPLAN_AU__TI_SI__24285DB4] DEFAULT ('ACT'),
[ST_AJUS_ORIG] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TMPLAN_AU__ST_AJ__2610A626] DEFAULT ('N'),
[ST_NIVE_ORIG] [dbo].[TD_VC_003] NULL,
[CO_CNRE_BORI] [dbo].[TD_VC_020_CNTA] NULL,
[CO_CNRE_RORI] [dbo].[TD_VC_020_CNTA] NULL,
[ST_VALI_ORIG] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TMPLAN_AU__ST_VA__29E1370A] DEFAULT ('N'),
[IM_LIMI_ORIG] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TMPLAN_AU__IM_LI__2BC97F7C] DEFAULT ((0)),
[ST_CAPI_ORIG] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TMPLAN_AU__ST_CA__2DB1C7EE] DEFAULT ('N'),
[ST_TICA_ORIG] [dbo].[TD_VC_003] NULL,
[ST_TIPO_ORIG] [dbo].[TD_VC_003] NULL,
[CO_USCR_ORIG] [dbo].[TD_VC_008_USUA] NOT NULL,
[FE_USCR_ORIG] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TMPLAN_AU__FE_US__2F9A1060] DEFAULT (getdate()),
[CO_USMO_ORIG] [dbo].[TD_VC_008_USUA] NOT NULL,
[CO_EMPR_DEST] [dbo].[TD_VC_002] NOT NULL,
[CO_CNTA_DEST] [dbo].[TD_VC_020_CNTA] NOT NULL,
[NU_ANNO_DEST] [dbo].[TD_IN_004_ANNO] NULL CONSTRAINT [DF__TMPLAN_AU__NU_AN__318258D2] DEFAULT (datepart(year,getdate())),
[CO_MONE_DEST] [dbo].[TD_VC_003] NOT NULL,
[ST_MONE_DEST] [dbo].[TD_VC_001_SINO] NOT NULL CONSTRAINT [DF__TMPLAN_AU__ST_MO__336AA144] DEFAULT ('N'),
[ST_AUXI_DEST] [dbo].[TD_VC_001_SINO] NOT NULL CONSTRAINT [DF__TMPLAN_AU__ST_AU__3552E9B6] DEFAULT ('N'),
[TI_AUXI_DEST] [dbo].[TD_VC_001] NULL,
[ST_DOCU_DEST] [dbo].[TD_VC_001_SINO] NOT NULL CONSTRAINT [DF__TMPLAN_AU__ST_DO__373B3228] DEFAULT ('N'),
[TI_DOCU_DEST] [dbo].[TD_VC_003] NULL,
[CO_CNCP_DEST] [dbo].[TD_VC_020_CNTA] NULL,
[ST_GEST_DEST] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TMPLAN_AU__ST_GE__3A179ED3] DEFAULT ('N'),
[CO_CNDE_DEST] [dbo].[TD_VC_020_CNTA] NULL,
[CO_CNCO_DEST] [dbo].[TD_VC_020_CNTA] NULL,
[CO_CNCI_DEST] [dbo].[TD_VC_020_CNTA] NULL,
[CO_GADI_DEST] [dbo].[TD_VC_020_CNTA] NULL,
[CO_PEDI_DEST] [dbo].[TD_VC_020_CNTA] NULL,
[CO_CNRE_DEST] [dbo].[TD_VC_020_CNTA] NULL,
[CO_FLCA_DEST] [dbo].[TD_VC_010] NULL,
[CO_FLAB_DEST] [dbo].[TD_VC_010] NULL,
[ST_CNCA_DEST] [dbo].[TD_VC_003] NOT NULL,
[ST_CNMO_DEST] [dbo].[TD_VC_001_SINO] NOT NULL CONSTRAINT [DF__TMPLAN_AU__ST_CN__41B8C09B] DEFAULT ('N'),
[ST_CNCT_DEST] [dbo].[TD_VC_003] NOT NULL,
[ST_CNNA_DEST] [dbo].[TD_VC_003] NOT NULL,
[ST_ORDE_DEST] [dbo].[TD_VC_001_SINO] NOT NULL CONSTRAINT [DF__TMPLAN_AU__ST_OR__43A1090D] DEFAULT ('N'),
[TI_SITU_DEST] [dbo].[TD_VC_003] NOT NULL CONSTRAINT [DF__TMPLAN_AU__TI_SI__4589517F] DEFAULT ('ACT'),
[ST_AJUS_DEST] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TMPLAN_AU__ST_AJ__477199F1] DEFAULT ('N'),
[ST_NIVE_DEST] [dbo].[TD_VC_003] NULL,
[CO_CNRE_BDES] [dbo].[TD_VC_020_CNTA] NULL,
[CO_CNRE_RDES] [dbo].[TD_VC_020_CNTA] NULL,
[ST_VALI_DEST] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TMPLAN_AU__ST_VA__4B422AD5] DEFAULT ('N'),
[IM_LIMI_DEST] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TMPLAN_AU__IM_LI__4D2A7347] DEFAULT ((0)),
[ST_CAPI_DEST] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TMPLAN_AU__ST_CA__4F12BBB9] DEFAULT ('N'),
[ST_TICA_DEST] [dbo].[TD_VC_003] NULL,
[ST_TIPO_DEST] [dbo].[TD_VC_003] NULL,
[CO_USCR_DEST] [dbo].[TD_VC_008_USUA] NOT NULL,
[FE_USCR_DEST] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TMPLAN_AU__FE_US__50FB042B] DEFAULT (getdate()),
[CO_USMO_DEST] [dbo].[TD_VC_008_USUA] NOT NULL,
[FE_USMO_DEST] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TMPLAN_AU__FE_US__51EF2864] DEFAULT (getdate()),
[FE_USMO_ORIG] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TMPLAN_AU__FE_US__52E34C9D] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__CO_CN__0F2D40CE] CHECK (([CO_CNTA_ORIG]>='0' AND [CO_CNTA_ORIG]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__CO_CN__17C286CF] CHECK (([CO_CNCP_ORIG]>='0' AND [CO_CNCP_ORIG]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__CO_CN__1A9EF37A] CHECK (([CO_CNDE_ORIG]>='0' AND [CO_CNDE_ORIG]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__CO_CN__1B9317B3] CHECK (([CO_CNCO_ORIG]>='0' AND [CO_CNCO_ORIG]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__CO_CN__1C873BEC] CHECK (([CO_CNCI_ORIG]>='0' AND [CO_CNCI_ORIG]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__CO_CN__1F63A897] CHECK (([CO_CNRE_ORIG]>='0' AND [CO_CNRE_ORIG]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__CO_CN__27F8EE98] CHECK (([CO_CNRE_BORI]>='0' AND [CO_CNRE_BORI]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__CO_CN__28ED12D1] CHECK (([CO_CNRE_RORI]>='0' AND [CO_CNRE_RORI]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__CO_CN__308E3499] CHECK (([CO_CNTA_DEST]>='0' AND [CO_CNTA_DEST]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__CO_CN__39237A9A] CHECK (([CO_CNCP_DEST]>='0' AND [CO_CNCP_DEST]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__CO_CN__3BFFE745] CHECK (([CO_CNDE_DEST]>='0' AND [CO_CNDE_DEST]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__CO_CN__3CF40B7E] CHECK (([CO_CNCO_DEST]>='0' AND [CO_CNCO_DEST]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__CO_CN__3DE82FB7] CHECK (([CO_CNCI_DEST]>='0' AND [CO_CNCI_DEST]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__CO_CN__40C49C62] CHECK (([CO_CNRE_DEST]>='0' AND [CO_CNRE_DEST]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__CO_CN__4959E263] CHECK (([CO_CNRE_BDES]>='0' AND [CO_CNRE_BDES]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__CO_CN__4A4E069C] CHECK (([CO_CNRE_RDES]>='0' AND [CO_CNRE_RDES]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__CO_GA__1D7B6025] CHECK (([CO_GADI_ORIG]>='0' AND [CO_GADI_ORIG]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__CO_GA__3EDC53F0] CHECK (([CO_GADI_DEST]>='0' AND [CO_GADI_DEST]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__CO_PE__1E6F845E] CHECK (([CO_PEDI_ORIG]>='0' AND [CO_PEDI_ORIG]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__CO_PE__3FD07829] CHECK (([CO_PEDI_DEST]>='0' AND [CO_PEDI_DEST]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__IM_LI__2CBDA3B5] CHECK (([IM_LIMI_ORIG]>=(0)))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__IM_LI__4E1E9780] CHECK (([IM_LIMI_DEST]>=(0)))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__NU_AN__11158940] CHECK (([NU_ANNO_ORIG]>=(0)))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__NU_AN__32767D0B] CHECK (([NU_ANNO_DEST]>=(0)))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__ST_AJ__2704CA5F] CHECK (([ST_AJUS_ORIG]='N' OR [ST_AJUS_ORIG]='S'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__ST_AJ__4865BE2A] CHECK (([ST_AJUS_DEST]='N' OR [ST_AJUS_DEST]='S'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__ST_AU__14E61A24] CHECK (([ST_AUXI_ORIG]='N' OR [ST_AUXI_ORIG]='S'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__ST_AU__36470DEF] CHECK (([ST_AUXI_DEST]='N' OR [ST_AUXI_DEST]='S'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__ST_CA__2EA5EC27] CHECK (([ST_CAPI_ORIG]='N' OR [ST_CAPI_ORIG]='S'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__ST_CA__5006DFF2] CHECK (([ST_CAPI_DEST]='N' OR [ST_CAPI_DEST]='S'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__ST_CN__214BF109] CHECK (([ST_CNMO_ORIG]='N' OR [ST_CNMO_ORIG]='S'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__ST_CN__42ACE4D4] CHECK (([ST_CNMO_DEST]='N' OR [ST_CNMO_DEST]='S'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__ST_DO__16CE6296] CHECK (([ST_DOCU_ORIG]='N' OR [ST_DOCU_ORIG]='S'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__ST_DO__382F5661] CHECK (([ST_DOCU_DEST]='N' OR [ST_DOCU_DEST]='S'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__ST_GE__19AACF41] CHECK (([ST_GEST_ORIG]='N' OR [ST_GEST_ORIG]='S'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__ST_GE__3B0BC30C] CHECK (([ST_GEST_DEST]='N' OR [ST_GEST_DEST]='S'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__ST_MO__12FDD1B2] CHECK (([ST_MONE_ORIG]='N' OR [ST_MONE_ORIG]='S'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__ST_MO__345EC57D] CHECK (([ST_MONE_DEST]='N' OR [ST_MONE_DEST]='S'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__ST_OR__2334397B] CHECK (([ST_ORDE_ORIG]='N' OR [ST_ORDE_ORIG]='S'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__ST_OR__44952D46] CHECK (([ST_ORDE_DEST]='N' OR [ST_ORDE_DEST]='S'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__ST_VA__2AD55B43] CHECK (([ST_VALI_ORIG]='N' OR [ST_VALI_ORIG]='S'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__ST_VA__4C364F0E] CHECK (([ST_VALI_DEST]='N' OR [ST_VALI_DEST]='S'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__TI_SI__251C81ED] CHECK (([TI_SITU_ORIG]='ANU' OR [TI_SITU_ORIG]='ACT'))
GO
ALTER TABLE [dbo].[TMPLAN_AUDI] ADD CONSTRAINT [CK__TMPLAN_AU__TI_SI__467D75B8] CHECK (([TI_SITU_DEST]='ANU' OR [TI_SITU_DEST]='ACT'))
GO
